<template>
  <div class="dashboard-container">
    <div class="dashboard-header">
      <h2>欢迎使用用户管理系统</h2>
      <p>选择左侧菜单开始操作</p>
    </div>
    
    <div class="dashboard-cards">
      <el-card class="card-item">
        <div class="card-content">
          <div class="card-icon el-icon-user"></div>
          <div class="card-info">
            <div class="card-title">用户管理</div>
            <div class="card-desc">管理系统用户信息</div>
          </div>
        </div>
      </el-card>
      
      <el-card class="card-item">
        <div class="card-content">
          <div class="card-icon el-icon-document"></div>
          <div class="card-info">
            <div class="card-title">日志管理</div>
            <div class="card-desc">查看系统操作记录</div>
          </div>
        </div>
      </el-card>
      
      <el-card class="card-item">
        <div class="card-content">
          <div class="card-icon el-icon-setting"></div>
          <div class="card-info">
            <div class="card-title">系统设置</div>
            <div class="card-desc">配置系统参数</div>
          </div>
        </div>
      </el-card>
    </div>
    
    <div class="dashboard-stats">
      <el-card class="stat-card">
        <div class="stat-content">
          <div class="stat-number">{{ totalUsers }}</div>
          <div class="stat-label">总用户数</div>
        </div>
      </el-card>
      
      <el-card class="stat-card">
        <div class="stat-content">
          <div class="stat-number">{{ activeUsers }}</div>
          <div class="stat-label">活跃用户</div>
        </div>
      </el-card>
      
      <el-card class="stat-card">
        <div class="stat-content">
          <div class="stat-number">{{ newUsers }}</div>
          <div class="stat-label">新增用户</div>
        </div>
      </el-card>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DashboardView',
  data() {
    return {
      totalUsers: 128,
      activeUsers: 86,
      newUsers: 12
    }
  },
  methods: {
    // 这里可以添加从API获取数据的方法
    fetchDashboardData() {
      // 实际项目中，这里应该调用API获取真实数据
      // 现在使用模拟数据
    }
  },
  mounted() {
    this.fetchDashboardData();
  }
}
</script>

<style scoped>
.dashboard-container {
  width: 100%;
  padding: 20px;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 20px 0;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dashboard-header h2 {
  color: #333;
  font-size: 28px;
  margin-bottom: 10px;
  font-weight: 600;
}

.dashboard-header p {
  color: #666;
  font-size: 16px;
}

.dashboard-cards {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.card-item {
  width: 300px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.card-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.card-content {
  display: flex;
  align-items: center;
  padding: 20px;
}

.card-icon {
  font-size: 48px;
  margin-right: 20px;
  color: #409eff;
}

.card-info .card-title {
  font-size: 20px;
  color: #333;
  margin-bottom: 5px;
  font-weight: 500;
}

.card-info .card-desc {
  font-size: 14px;
  color: #666;
}

.dashboard-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.stat-card {
  width: 200px;
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.stat-content {
  padding: 20px;
}

.stat-number {
  font-size: 36px;
  font-weight: 600;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 16px;
  opacity: 0.9;
}
</style>